package com.xpffly.design.decorator.demo.service.impl;

import com.xpffly.design.decorator.demo.service.SchoolReport;

/**
 * @Author: xpengfei
 * @Date: 2021/4/8 23:16
 * @Description：修饰的抽象类
 * 此装饰类的目的就是为了让该装饰类的子类能够封装被装饰对象（SchoolReport）
 */
public abstract class Decorator extends SchoolReport {
    /**
     * 定义变量，以便直到是哪个成绩单
     */
    private SchoolReport schoolReport;

    /**
     * 构造方法传递成绩单
     *
     * @param schoolReport
     */
    public Decorator(SchoolReport schoolReport) {
        this.schoolReport = schoolReport;
    }

    /**
     * 展示成绩情况
     */
    @Override
    public void report() {
        this.schoolReport.report();
    }

    /**
     * 家长签字
     */
    @Override
    public void sign() {
        this.schoolReport.sign();
    }
}
